#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys

def main():
    if len(sys.argv) != 3:
        print "Usage: make_js_nes [inp file] [out file]"
        return
    with open(sys.argv[1], 'rb') as f:
        x = f.read()
    x = x.encode('hex')
    a = 'data="'
    for i in xrange(len(x) / 2):
        a += '\\x' + x[i * 2] + x[i * 2 + 1]
    a += '"'
    with open(sys.argv[2], 'wb') as f:
        f.write(a)

if __name__ == '__main__':
    main()
